home *** CD-ROM | disk | FTP | other *** search
- /***
- * URLHLibrary.h
- *
- * Library routines to make integration of the URLHelper component into
- * programs that much simpler...
- *
- ***/
-
- #pragma once
-
- #include "URLHelperComponent.h"
-
- void URLHLibGetFirstMirror (StringPtr baseURL, StringPtr mirrorURL);
-
- URLHParseRef URLHLibNewParseState (StringPtr baseURL);
- Boolean URLHLibGetIndexedMirror (URLHParseRef parseRef, short index, StringPtr mirrorURL);
- void URLHLibDisposeParseState (URLHParseRef parseRef);
-
- OSErr URLHLibOpen (void);
- void URLHLibClose (void);
- void URLHLibUse (URLHelperComponent instance);
-
- /**
- ** Routines
- **
- ** URLHLibGetFirstMirror -- Given a baseURL will return the primary mirror. It will
- ** (should!) never fail. If something goes wrong (the component
- ** isn't installed, etc.) it will return the baseURL in the mirrorURL.
- ** It is ok to have baseURL and mirrorURL point to the same memory
- ** location.
- **
- ** The next three routines are meant to be used together. They enable one to get to more
- ** that just the primary mirror in the mirror list (there can be any number of mirrors
- ** in a particular mirror list). For this you need to keep track of some temporary variable
- ** that holds a "parse" state. Again, these things are designed to work even if the component
- ** is missing from the system.
- **
- ** URLHLibNewParseState -- Given a baseURL it will return a search/parse state. Use this
- ** in calles to URLHLibGetIndexedMirror to get each and every mirror
- ** in the mirror list.
- ** URLHLibGetIndexedMirror -- For the parse state and an index into the list, return a
- ** mirror url. This will return true as long as index corresponds to
- ** a good mirror.
- ** URLHLibDisposeParseState -- Get rid of the memory used to hold the parse state.
- **
- ** The next two routines are utility. Only the second one, URLHLibClose, should be used in
- ** an application... in general. You can use URLHLibOpen to test to see if the component is
- ** present in the system.
- **
- ** URLHLibOpen -- No need for you to call this (called automatically). It will attempt to
- ** open the component. Returns -1 if it can't find the component.
- **
- ** URLHLibClose -- Close the connection to the component if it was open in the first place.
- ** If your program uses this component it is a good idea to call this
- ** before you exit (it dosen't matter if you didn't use the component during
- ** this run -- LibClose will only close the component if it was opened in the
- ** first place).
- ** URLHLibUse -- Use a particular instance of the url helper component. It will close
- ** any component it already had open (even if it was opened by this routine!)
- ** so watch it!
- **/